home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17401 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.7 KB

  1. Path: gaia.ns.utk.edu!mbk
  2. From: mbk@caffeine.engr.utk.edu (Matt Kennel)
  3. Newsgroups: comp.object,comp.lang.c++
  4. Subject: Re: The Good, the Bad, the Ugly, and the Wicked ...
  5. Followup-To: comp.object,comp.lang.c++
  6. Date: 15 Apr 1996 18:34:06 GMT
  7. Organization: University of Tennessee, Knoxville and Oak Ridge National Laboratory
  8. Message-ID: <4ku4qu$f21@gaia.ns.utk.edu>
  9. References: <31570B8E.5A12@vmark.com> <4je5rq$7qg@mimas.brunel.ac.uk>  <4jes0t$gth@decaxp.HARVARD.EDU> <31630E30.5A02@oma.com>  <4kbq3q$1i8@gaia.ns.utk.edu> <JSA.96Apr9131057@organon.com>  <RMARTIN.96Apr10133335@rcm.oma.com> <JSA.96Apr11153135@organon.com> <milodDprBA9.FyH@netcom.com>
  10. Reply-To: kennel@msr.epm.ornl.gov
  11. NNTP-Posting-Host: caffeine.engr.utk.edu
  12. X-Newsreader: TIN [version 1.2 PL2]
  13.  
  14. John DiCamillo (milod@netcom.com) wrote:
  15. : jsa@organon.com (Jon S Anthony) writes:
  16. : >In article <RMARTIN.96Apr10133335@rcm.oma.com> rmartin@oma.com (Robert C. Martin) writes:
  17.  
  18. : >> Robert C. Martin (rmartin@oma.com) wrote:
  19. : >> 
  20. : >>    > : Malloc and new can *always* be made to be deterministic.
  21.  
  22. : [Jon and Matt disagree]
  23.  
  24. : >> You missed my point.  new/delete can *always be made* to be completely
  25. : >> deterministic.  Consider:
  26. : >> 
  27. : >> [example...]
  28.  
  29. : >1. Yes, we (Matt and I) both missed your point (assuming it was the
  30. : >   one you are now claiming) - probably because this is not what you
  31. : >   said.
  32.  
  33. : Huh?  What Robert wrote was perfectly clear both times.  For reasons
  34. : unknown (time pressure? the desire to argue on the net?) both you and
  35. : Matt mis-interpreted Robert's post as if it had read
  36. :   'any old malloc can be *used* in a deterministic manner'
  37. : instead of
  38. :   'it is possible to *make* a deterministic malloc'
  39.  
  40. I assumed that what was meant by "malloc" was the standard library
  41. function which does general automatic heap allocation using the
  42. conventional algorithms.  (why else call it malloc?) I was using "malloc" 
  43. as a brand name. :-)
  44.  
  45. The point is that I think this "malloc" should be termed some sort of
  46. "automatic memory management" like garbage collection. 
  47.  
  48. Robert Martin suggested that one could write one's own deterministic
  49. special cased memory allocation for limited circumstances.  
  50.  
  51. He called this function 'malloc' but I wouldn't since it doesn't do the
  52. same thing as real malloc.  I'd call that function "get a memory block of
  53. foobar-size from my preallocated special array of foobar-sized blocks". 
  54.  
  55. I'd call this 'manual memory management'. 
  56.  
  57. I agree to this:
  58.  
  59.     Some circumstances require manual deterministic memory management.
  60.  
  61. I object to this:
  62.  
  63.     Standard malloc() and free() is manual deterministic memory managment.
  64.  
  65.  
  66. The point being is that if you reject GC for real-time reasons, it is
  67. inconsistent to suggest that malloc() and free() are fundamentally 
  68. any better.   
  69.